import 'package:finance_app/src/entities/salary_user_working_days_entity.dart';

salaryUserWorkingDaysEntityFromJson(SalaryUserWorkingDaysEntity data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['days'] != null) {
		data.days = json['days'] is String
				? num.tryParse(json['days'])
				: json['days'];
	}
	if (json['beforeHiringDate'] != null) {
		data.beforeHiringDate = json['beforeHiringDate'];
	}
	return data;
}

Map<String, dynamic> salaryUserWorkingDaysEntityToJson(SalaryUserWorkingDaysEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['days'] = entity.days;
	data['beforeHiringDate'] = entity.beforeHiringDate;
	return data;
}